#! /usr/bin/python
# -*- coding: UTF-8 -*-

import os
import os.path

__BASE_DIR__ = os.path.dirname(os.path.realpath(__file__)) + os.sep

# Include main file
if os.path.isfile(__BASE_DIR__ + 'main.py'):
    execfile(__BASE_DIR__ + 'main.py')


class App(wx.App):
    """Application class."""

    def OnInit(self):
        self.name = __app_name__ + "-%s" % (wx.GetUserId())
        self.instance = wx.SingleInstanceChecker(self.name)
        if self.instance.IsAnotherRunning():
            return False

        self.frame = MyTwitter(parent=None, id=-1)
        self.frame.Show()
        self.SetTopWindow(self.frame)
        return True


def Main():
    app = App()
    app.MainLoop()


if __name__ == '__main__':
    Main()